package com.atguigu.repository;

import com.atguigu.bean.Goods;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

public interface GoodsRespository  extends ElasticsearchRepository<Goods, String> {
    @Query("{\n" +
            "    \"range\": {\n" +
            "      \"price\": {\n" +
            "        \"gte\": ?0,\n" +
            "        \"lte\": ?1\n" +
            "      }\n" +
            "    }\n" +
            "  }")
    List<Goods> findByPriceBetween2(Double price1 , Double price2);
}
